package com.greenhouse.protocol;

import java.util.List;
import java.util.Set;

import com.greenhouse.protocol.bean.MqttChannel;
import com.greenhouse.protocol.bean.WillMeaasge;

import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttConnectMessage;
import io.netty.handler.codec.mqtt.MqttPublishMessage;

/**
 * 消息处理
 *
 **/
public interface ChannelService {

	MqttChannel getMqttChannel(String deviceId);

	boolean connectSuccess(String s, MqttChannel build);

	void suscribeSuccess(String deviceId, Set<String> topics);

	void loginSuccess(Channel channel, String deviceId, MqttConnectMessage mqttConnectMessage);

	void publishSuccess(Channel channel, MqttPublishMessage mqttPublishMessage);

	void closeSuccess(String deviceId, boolean isDisconnect);

	void sendWillMsg(WillMeaasge willMeaasge);

	String getDeviceId(Channel channel);

	void unsubscribe(String deviceId, List<String> topics1);

	void doPubrel(Channel channel, int mqttMessage);

	void doPubrec(Channel channel, int mqttMessage);

	/**
	 * @Title: getOnLineDeviceNum
	 * @Description: TODO(这里用一句话描述这个方法的作用)
	 * @return    參數描述
	 * @author: 雷扬
	 * @return int  返回类型
	 * @throws
	 */
	int getOnLineDeviceNum();

}
